package com.hooya.fa.eu.biz.dao.mapper.stk;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hooya.fa.eu.biz.dao.entity.TempThjl;
import com.hooya.fa.eu.biz.dao.entity.dto.TempKcjlDailyHyDTO;
import com.hooya.fa.eu.biz.dao.entity.dto.ThDataDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2024/3/18
 * @Version 1.0.0
 */
@Mapper
public interface TempThjlMapper extends BaseMapper<TempThjl> {

	@Select("SELECT sum(sl) as sl, cpbh, place, belongs, date FROM fa_eu.temp_thjl WHERE date >= #{startDate} AND date < #{endDate} AND belongs LIKE #{prefix1} OR belongs LIKE #{prefix2} GROUP BY cpbh,place,belongs,date")
	List<TempKcjlDailyHyDTO> getThjlData(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("prefix1")String prefix1, @Param("prefix2")String prefix2);

	void insertBatchSomeColumn(List<TempThjl> list);

	@DS("fa_eu_daily")
	void insertBatchSomeColumnDaily(@Param("list") List<TempThjl> list);

    @Select("select * from temp_thjl where date <= #{date}")
    List<TempThjl> getLtDateList(@Param("date") String date);

	List<ThDataDTO> getThMainData(@Param("start") String start, @Param("end") String end);
}
